<template>
  <div class="content">
    <div class="list-c">
      <div class="item" v-for="(item, index) in orderList" :key="index">
        <div class="googs-c" @click="orderDetail">
          <div class="goods" v-for="(itx, idx) in item.product_list" :key="idx">
            <span class="s-l">{{itx.product_name}}</span>
            <span class="s-r">x{{itx.product_count}}</span>
          </div>
        </div>
        <div class="price">
          <span class="count">共{{item.product_list.length}}件商品，实付</span>
          <span class="amount">￥{{item.total}}</span>
        </div>
        <div class="bottom-c" @click="headerClick">
          <div class="btn">
            <span>再来一单</span>
          </div>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
import { orderList } from "./data";

export default {
  data() {
    return {
      orderList: []
    };
  },
  methods: {
    headerClick() {},
    orderDetail() {}
  },
  mounted() {
    this.orderList = orderList.data.digestlist;
  }
};
</script>

<style lang="less" scoped>
.content {
  background: whitesmoke
}
.list-c {
  display: flex;
  flex-direction: column;
  
  .item {
    display: flex;
    flex-direction: column;
    background-color: white;
    margin-bottom: 20rpx;
    padding-top: 20rpx;
    .googs-c {
      display: flex;
      background-color: white;
      flex-direction: column;
      .goods {
        display: flex;
        align-items: center;
        justify-content: space-between;
        margin-left: 60rpx;
        margin-right: 20rpx;
        .s-l {
          font-size: 28rpx;
          padding: 10rpx 0;
        }
        .s-r {
          font-size: 24rpx;
        }
      }
    }
    .price {
      display: flex;
      margin: 20rpx;
      justify-content: flex-end;
      .count {
        font-size: 24rpx;
      }
      .amount {
        font-size: 24rpx;
        font-weight: bold;
      }
    }
    .bottom-c {
      display: flex;
      margin-left: 60rpx;
      margin-right: 20rpx;
      border-top: 2rpx solid lightgray;
      align-items: center;
      background-color: white;
      justify-content: flex-end;
      .btn {
        display: flex;
        align-items: center;
        justify-content: center;
        border: 2rpx solid lightgray;
        margin: 20rpx;
        border-radius: 4rpx;
        span {
          font-size: 28rpx;
          margin: 16rpx 24rpx;
        }
      }
    }
  }
}
</style>
